package com.geekaca.d4.d3;

import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalDateTime;

public class TestDuration {
    public static void main(String[] args) {
        /**
         * 时间的相差
         */
        // 本地当前时间对象
        LocalDateTime today =LocalDateTime.now();
        System.out.println(today    );

        // 出生的日期时间对象
        LocalDateTime birthDate = LocalDateTime.of(1981,12,26,0,0,0 );

        Duration duration = Duration.between(birthDate,today);
        System.out.println(duration.toDays());
    }
}
